package com.efeichong.oss;

/**
 * @author lxk
 * @date 2020/10/21
 * @description 字符串处理工具类
 */
class StringUtils {
    private static final int PAD_LIMIT = 8192;

    /**
     * 判断为空，空格，空字符
     *
     * @param cs 字符
     * @return
     */
    public static boolean isBlank(CharSequence cs) {
        int strLen;
        if (cs != null && (strLen = cs.length()) != 0) {
            for (int i = 0; i < strLen; ++i) {
                if (!Character.isWhitespace(cs.charAt(i))) {
                    return false;
                }
            }

            return true;
        } else {
            return true;
        }
    }

    /**
     * 判断不为空，空格，空字符
     *
     * @param cs 字符
     * @return
     */
    public static boolean isNotBlank(CharSequence cs) {
        return !isBlank(cs);
    }
}
